﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DotNet.Business;

public partial class newsDetail : System.Web.UI.Page
{
    #region 变量
    Tab_NewsBll tab_NewsBll = new Tab_NewsBll();
    Tab_NewClassBll tab_NewClassBll = new Tab_NewClassBll();   
    /// <summary>
    /// 新闻ID
    /// </summary>
    int _id = 0;
    /// <summary>
    /// 新闻类别ID
    /// </summary>
    int _classID = 0;
    /// <summary>
    /// 新闻类别名称
    /// </summary>
    public string _className = "";
    /// <summary>
    /// 新闻名称
    /// </summary>
    public string _newName = "";
    /// <summary>
    /// 新闻内容
    /// </summary>
    public string _info = "";
    /// <summary>
    /// 新闻添加事件
    /// </summary>
    public string _AddDate = "";
    #endregion

    #region 页面加载
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                this._id = Convert.ToInt32(Request.QueryString["id"]);
                //绑定详细
                this.bindNews();
            }
        }
    }
    #endregion

    #region 绑定详细
    /// <summary>
    /// 绑定详细
    /// </summary>
    private void bindNews() 
    {
        Tab_News tab_News = new Tab_News();
        tab_News = tab_NewsBll.GetModel(this._id);
        this._newName = tab_News.newName;
        this._info = tab_News.newInfo;
        this._AddDate = tab_News.newAddDate;
        this._classID = tab_News.newClassID;
        Tab_NewClass tab_NewClass = new Tab_NewClass();
        tab_NewClass=tab_NewClassBll.GetModel(this._classID);
        this._className=tab_NewClass.newClassName;
    }
    #endregion

}
